<%@page import="com.situ.personal.entity.Role"%>
<%@page import="com.situ.personal.entity.User"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<!--  1个userId 对应 多个roleId      所以转发  转1个userId 和 对应的多个RoleId(数组的形式)   -->
	
	<%
	List<User> userList = (List<User>)request.getAttribute("userList");
	List<Role> roleList = (List<Role>)request.getAttribute("roleList");
	%>
	<form action="<%=request.getContextPath()%>/userRole?method=insert" method="post">
		用户：<select name="userId">
				<%
				for(User user:userList){
				%>
					<option value="<%=user.getId() %>"><%=user.getName()%></option>
				<%
				}					
				%>	
			 </select>
		角色：<select name="roleId" multiple="multiple">
				<%
				for(Role role:roleList){
				%>
					<option value="<%=role.getId()%>"><%=role.getName()%></option>
				<%
				}					
				%>	
			 </select>
		<br/>
		<input type="submit" value="提交"/>
	</form>
</body>
</html>